/* ===================================================================
 * Copyright (C) 2024 Hefei Jiushao Intelligent Technology Co., Ltd.
 * All rights reserved.
 *
 * This software is licensed under the GNU Affero General Public License
 * v3.0 (AGPLv3.0) or a commercial license. You may choose to use this
 * software under the terms of either license.
 *
 * For more information about the AGPLv3.0 license, please visit:
 * https://www.gnu.org/licenses/agpl-3.0.html
 * For licensing inquiries or to obtain a commercial license, please
 * contact Hefei Jiushao Intelligent Technology Co., Ltd.
 * ===================================================================
 * Author: Yu HongFeng
 */

#ifndef SYATEM_LOG_H
#define SYATEM_LOG_H

#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_TRACE // 在include spdlog.h之前定义，更改SPDLOG_XXX系列宏的日志级别

#include <string>
#include <vector>
#include "spdlog/spdlog.h"
#include "spdlog/async.h"
#include "spdlog/sinks/daily_file_sink.h"
#include "spdlog/stopwatch.h"
#include "spdlog/sinks/stdout_color_sinks.h"

void InitSpdlog(const std::string &logLevel = "debug", const std::string &fileName = "run.log");

#define LOG_TRACE(...) SPDLOG_TRACE(__VA_ARGS__)
#define LOG_DEBUG(...) SPDLOG_DEBUG(__VA_ARGS__)
#define LOG_INFO(...) SPDLOG_INFO(__VA_ARGS__)
#define LOG_WARN(...) SPDLOG_WARN(__VA_ARGS__)
#define LOG_ERROR(...) SPDLOG_ERROR(__VA_ARGS__)
#define LOG_CRITICAL(...) SPDLOG_CRITICAL(__VA_ARGS__)

#define LOG_STUB LOG_INFO(" stub")

#endif // SYATEM_LOG_H